package com.algo.ext;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    /**
     * 监听器的一种实现方式
     * @param event
     */
    @EventListener(value = MyApplicationEvent.class)
    public void lisener(MyApplicationEvent event){
        System.out.println("userService中监听到事件。。。" + event);
    }

}
